<?php
class filter
{
	function __construct(){
		$script = '<script>
					$.datepicker.regional[""].dateFormat = "yy-mm-dd";
					$.datepicker.setDefaults($.datepicker.regional[""]);
					$(document).ready(function(){
						$("#tblTabla").dataTable({
							"bPaginate": false,
							"oLanguage": {
								"sEmptyTable": "No hay datos para mostrar",
								"sZeroRecords": "No se encontraron resultados",
								"sLoadingRecords": "Cargando...",
								"sInfo": "_TOTAL_ resultados",
								"sInfoEmpty": "No se encontraron resultados",
								"sInfoFiltered": " - (de _MAX_ en total)",
								"sSearch": "Buscar"
							}
						}).columnFilter({
							aoColumns:[';
		if(!empty($_GET['obj'])){
			switch($_GET['obj'])
			{
					case "repgan":
						echo $script = $script .'	null,
													{type:"text"},
													{type:"text"},
													{type: "select", values: [ "M", "F"]},
													{type:"text"},
													{type:"text"},
													{type:"text"}
										]
									});
								});
							</script>';
					break;
					case "repins":
						echo $script = $script .'	{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"date-range"},
													{type:"text"}
										]
									});
								});
							</script>';
					break;
					case "repprov":
						echo $script = $script .'	{type: "select", values: [ "Cliente", "Proovedor", "Ambas"]},
													{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"text"}
												]
									});
								});
							</script>';
					break;
					case "repcomven":
						echo $script = $script .'	null,
													{type:"text"},
													 null,
													{type:"text"},
													{type:"text"},
													{type:"date-range"},
													{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"text"}
										]
									});
								});
							</script>';
					break;
					case "aplins":
						echo $script = $script .'	{type:"text"},
													{type:"text"},
													{type:"text"},
													{type:"date-range"},
													{type:"text"}
										],
										sPlaceHolder: "head:before"
									});
								});
							</script>';
					break;
					default:     			$script='';						break;
			}	
		}
	}
}
?>
